getCssFile($fs, $rTrimPath); $inspectorHelper = new InspectorHelper(); if ($cssFile !== null) { $cssFileContent = $fs->read($rTrimPath . $cssFile); if ( $inspectorHelper->fileContentContainsString($cssFileContent, 'dmDudaonePreviewBody') || $inspectorHelper->fileContentContainsString($cssFileContent, 'dudaSnipcartProductGalleryId') ) { return new MatchResult($path); } } if (!$fs->fileExists($rTrimPath . self::RUNTIME_JS_FILE)) { return new EmptyMatchResult(); } return $inspectorHelper->fileContainsString($fs, $rTrimPath . self::RUNTIME_JS_FILE, 'duda') ? new MatchResult($path) : new EmptyMatchResult(); } private function getCssFile(Filesystem $fs, string $path): ?string { foreach (self::CSS_FILES as $cssFile) { if ($fs->fileExists($path . $cssFile)) { return $cssFile; } } return null; } }